Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CAS logout URL config in web.xml. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ionparticle
Copy link
Contributor

The CAS logout URL can now be configured in web.xml instead of being hard coded
in logout.jsp. This was done by adding a logout filter. Going to the url
/cat/auth/logout will now log you out of the application.

This also fixes a minor execution order bug on logout that leads to the session
persisting after the first logout. The execution flow in the original
logout.jsp goes: Application clears session, logout.jsp loads "My Courses"
page, logout.jsp goes to CAS logout page to clear CAS session. What happens in
our environment is that when logout.jsp loads "My Course", because its CAS
session hasn't been expired, it was able to reauthenticate and recreate the
application session. The workaround is to press logout again to truly logout.
The actual fix swaps the last two operations so that it goes: Application
clears session, redirects to CAS logout page to clear CAS session, redirects to
"My Courses".

Redirecting to "My Courses" needs to be done by the CAS server since the
browser was redirect to the CAS page. Luckily, there is a "service" parameter
that you can pass to the CAS logout url that tells the CAS server where to go
after logout.

Fixes #2

The CAS logout URL can now be configured in web.xml instead of being hard coded
in logout.jsp. This was done by adding a logout filter. Going to the url
/cat/auth/logout will now log you out of the application.

This also fixes a minor execution order bug on logout that leads to the session
persisting after the first logout. The execution flow in the original
logout.jsp goes: Application clears session, logout.jsp loads "My Courses"
page, logout.jsp goes to CAS logout page to clear CAS session. What happens in
our environment is that when logout.jsp loads "My Course", because its CAS
session hasn't been expired, it was able to reauthenticate and recreate the
application session. The workaround is to press logout again to truly logout.
The actual fix swaps the last two operations so that it goes: Application
clears session, redirects to CAS logout page to clear CAS session, redirects to
"My Courses".

Redirecting to "My Courses" needs to be done by the CAS server since the
browser was redirect to the CAS page. Luckily, there is a "service" parameter
that you can pass to the CAS logout url that tells the CAS server where to go
after logout.

Fixes usaskulc#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logout redirection is hard coded
1 participant